﻿using HamcoWcs.Entitys.Bases;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;

namespace HamcoWcs.Entitys.BaseConfigs
{
    public class DeviceEvent : BaseEntity, IEntityTypeConfiguration<DeviceEvent>
    {
        public string MachineName { get; set; }
        public string PortName { get; set; }
        public string Description { get; set; }
        public DateTime SetTime { get; set; }
        public void Configure(EntityTypeBuilder<DeviceEvent> builder)
        {
            builder.HasComment("PLC全局配置表");
            builder.Property(x => x.MachineName).IsRequired().HasMaxLength(100).HasComment("设备名");
            builder.Property(x => x.PortName).IsRequired().HasMaxLength(100).HasComment("port名");
            builder.Property(x => x.Description).IsRequired().HasMaxLength(255).HasComment("描述");
        }
    }
}
